<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{num}}</div>
        <div v-on:click='handle0'>
            <!--1. .stop 阻止冒泡 -->
            <button v-on:click.stop='handle1'>点击1</button>
        </div>
        <div>
            <!--2.  .prevent 阻止默认行为 -->
            <a href="http:www.baidu.com" v-on:click.prevent='handle2'>百度</a>
        </div>
    </div>
    <script src="js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                num: 0
            },
            methods: {
                handle0: function() {
                    this.num++;
                },
                handle1: function(event) {
                    // 阻止冒泡
                    // event.stopPropagation();
                },
                handle2: function(event) {
                    //阻止默认行为
                    //event.preventDefault();
                }
            }
        });
    </script>
</body>

</html>